/// ===========================================================================
/// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
/// KIND, WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
/// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
/// PURPOSE.
/// ===========================================================================
/// 
/// Project:        MOSS Faceted Search
/// Author:         Leonid Lyublinski (leonidly@microsoft.com)
/// Company:        Microsoft Services
/// Date:           05/04/2007  Version:        1.0
///
/// ===========================================================================

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.SharePoint.Portal.ExtendedSearch.Common
{
    public class Constants
    {
        public const string KEY = "FacetedSearch";
        public const string CAML_QUERY_WEBPARTS = @"
            <?xml version=""1.0"" encoding=""utf-8"" ?>
            <Query>
            <![CDATA[
                <Where>
                    <Eq>
                         <FieldRef Name=""Title"" />
                         <Value Type=""Text"">SearchFacets.webpart</Value>
                    </Eq>
                </Where>
            ]]>
            </Query>
        ";

        public const string WEB_PART_GALLERY_NAME = "Web Part Gallery";
        public const string SEARCH_FACETS_WEBPART_NAME = "Search Facets";
        public const string SEARCH_BREADCRUMBS_WEBPART_NAME = "Search Bread Crumbs";
        
        public const short RESULTS_PER_PAGE_MIN = 300;
        public const short RESULTS_PER_PAGE_MAX = 500;
        public const string IMAGES_FOLDER = "~/_layouts/images/";

        internal const string SCRIPT_NAME = "Microsoft.SharePoint.Portal.ExtendedSearch.FacetedSearch.js";
        internal const string UNNAMED_FACET_VALUE = "(----none----)";
        internal const string REGEX_QUERYSTRING_SPLITTER = @"(?:^|\s+)(?<{0}>(\w+)):""(?<{1}>([^""]+))""";
        internal const string REGEX_LOOKUP_SPLITTER = @"(?:;\#)\d+;\#";
        internal const string REGEX_CHOICE_SPLITTER = @"\d+;\#";
        internal const string HTML_DELIMITER = "#|#";
            
        public const string EXCLUDED_PROPERTIES = "duplicate";

        #region WP Properties
        // web part properties' categories
        internal const string WP_CATEGORYNAME_CSS = "CSS Classes";
        internal const string WP_CATEGORYNAME_VISUAL = "Visual Settings";
        internal const string WP_CATEGORYNAME_DATA = "Data Settings";
        internal const string WP_CATEGORYNAME_CACHE = "Cache Settings";

        // Search Facets WP
        internal const string WP_SEARCHFACETS_CACHINGENABLED_FRIENDLYNAME = "Enable Caching";
        internal const string WP_SEARCHFACETS_CACHINGENABLED_DESCRIPTION = "When On, facet results are cached.";
        
        internal const string WP_SEARCHFACETS_LONGTIMEOUT_FRIENDLYNAME = "Long Cache Timeout (min)";
        internal const string WP_SEARCHFACETS_LONGTIMEOUT_DESCRIPTION = "The fixed timeout for 2nd run cache expiration.";

        internal const string WP_SEARCHFACETS_FASTTIMEOUT_FRIENDLYNAME = "Fast Cache Timeout (min)";
        internal const string WP_SEARCHFACETS_FASTTIMEOUT_DESCRIPTION = "The fixed timeout for 1st run cache expiration.";
        
        internal const string WP_SEARCHFACETS_SELECTCOLUMNS_FRIENDLYNAME = "Select Columns for Facets";
        internal const string WP_SEARCHFACETS_SELECTCOLUMNS_DESCRIPTION = "Selected columns should be defined as managed properties BEFORE. They will get available as search facets.";

        internal const string WP_SEARCHFACETS_RESULTSPERPAGE_FRIENDLYNAME = "Total Results";
        internal const string WP_SEARCHFACETS_RESULTSPERPAGE_DESCRIPTION = "Number of results returned by the search to selectively define facets.";

        internal const string WP_SEARCHFACETS_HIDDENRULE_FRIENDLYNAME = "Hidden Rule";
        internal const string WP_SEARCHFACETS_HIDDENRULE_DESCRIPTION = "A property assignment that will be always added to the search criteria. Useful for custom scopes. Format as in the Rule <prop name> = <prop value>.";

        internal const string WP_SEARCHFACETS_SCOPE_FRIENDLYNAME = "Scope";
        internal const string WP_SEARCHFACETS_SCOPE_DESCRIPTION = "Default Scope if none is specified explicitely.";

        internal const string WP_SEARCHFACETS_PREFIXENABLED_FRIENDLYNAME = "Prefix search";
        internal const string WP_SEARCHFACETS_PREFIXENABLED_DESCRIPTION = "Will use prefix search in addition to the default suffix search.";

        internal const string WP_SEARCHFACETS_QUERYMETHOD_FRIENDLYNAME = "Query Method";
        internal const string WP_SEARCHFACETS_QUERYMETHOD_DESCRIPTION = "Choice of query processing.";

        internal const string WP_SEARCHFACETS_LISTCSS_FRIENDLYNAME = "List CSS Class";
        internal const string WP_SEARCHFACETS_LISTCSS_DESCRIPTION = "Select CSS class for the entire list.";

        internal const string WP_SEARCHFACETS_FACETNAMECONTAINERCSS_FRIENDLYNAME = "Facet Name Container CSS Class";
        internal const string WP_SEARCHFACETS_FACETNAMECONTAINERCSS_DESCRIPTION = "Select CSS class for the facet header container.";

        internal const string WP_SEARCHFACETS_FACETNAMECSS_FRIENDLYNAME = "Facet CSS Class";
        internal const string WP_SEARCHFACETS_FACETNAMECSS_DESCRIPTION = "Select CSS class for the facet header.";

        internal const string WP_SEARCHFACETS_FACETLISTCSS_FRIENDLYNAME = "Facet List CSS Class";
        internal const string WP_SEARCHFACETS_FACETLISTCSS_DESCRIPTION = "Select CSS class for the entire list of facets.";

        internal const string WP_SEARCHFACETS_FACETVALUECONTAINERCSS_FRIENDLYNAME = "Facet Value Container CSS Class";
        internal const string WP_SEARCHFACETS_FACETVALUECONTAINERCSS_DESCRIPTION = "Select CSS class for the facet value container.";

        internal const string WP_SEARCHFACETS_FACETVALUECSS_FRIENDLYNAME = "Hit CSS Class";
        internal const string WP_SEARCHFACETS_FACETVALUECSS_DESCRIPTION = "Select CSS class for the facet value.";

        internal const string WP_SEARCHFACETS_CROPMAX_FRIENDLYNAME = "Maximum Length of the Facet";
        internal const string WP_SEARCHFACETS_CROPMAX_DESCRIPTION = "Maximum number of characters in a facet before truncation.";

        internal const string WP_SEARCHFACETS_SHOWEMPTYFACET_FRIENDLYNAME = "Show Empty Facet";
        internal const string WP_SEARCHFACETS_SHOWEMPTYFACET_DESCRIPTION = "Will cause show facets that don't have values.";

        internal const string WP_SEARCHFACETS_SHOWHEADER_FRIENDLYNAME = "Show Header";
        internal const string WP_SEARCHFACETS_SHOWHEADER_DESCRIPTION = "The header with the caching status and # of processed results.";

        // Bread Crumbs WP
        internal const string WP_BREADCRUMBS_CRUMBCSS_FRIENDLYNAME = "Crumb CSS";
        internal const string WP_BREADCRUMBS_CRUMBCSS_DESCRIPTION = "CSS class for the crumb.";

        internal const string WP_BREADCRUMBS_CRUMBHOVERCSS_FRIENDLYNAME = "Crumb Hover CSS";
        internal const string WP_BREADCRUMBS_CRUMBHOVERCSS_DESCRIPTION = "CSS class for the crumb hover.";

        internal const string WP_BREADCRUMBS_CONTAINERCSS_FRIENDLYNAME = "Container CSS Class";
        internal const string WP_BREADCRUMBS_CONTAINERCSS_DESCRIPTION = "Select CSS class for the entire container.";

        internal const string WP_BREADCRUMBS_HEADERCSS_FRIENDLYNAME = "Keyword CSS Class";
        internal const string WP_BREADCRUMBS_HEADERCSS_DESCRIPTION = "Select CSS class for the keyword.";

        internal const string WP_BREADCRUMBS_FACETCONTAINERCSS_FRIENDLYNAME = "Facet Container CSS Class";
        internal const string WP_BREADCRUMBS_FACETCONTAINERCSS_DESCRIPTION = "Select CSS class for the facet container.";

        internal const string WP_BREADCRUMBS_FACETCSS_FRIENDLYNAME = "Facet CSS Class";
        internal const string WP_BREADCRUMBS_FACETCSS_DESCRIPTION = "Select CSS class for the facet header.";

        internal const string WP_BREADCRUMBS_REPEATCOLUMNS_FRIENDLYNAME = "Repeat Columns";
        internal const string WP_BREADCRUMBS_REPEATCOLUMNS_DESCRIPTION = "Number of table columns.";

        internal const string WP_BREADCRUMBS_SEPARATOR_FRIENDLYNAME = "Bread Separator";
        internal const string WP_BREADCRUMBS_SEPARATOR_DESCRIPTION = "Will be used to separate bread crumbs."; 
        #endregion

        internal const string EXCEPTION_POLICY_NAME = "Faceted Search Policy";
    }
}
